import Vue from "vue";

// 这里只负责药神卡页面的数据
export default ({
    namespaced: true,
    state() {
        return {
            historylist: [],//历史记录
            searchKey: '',  //首页的热搜词
        }
    },
    mutations: {
        inithistorylist(state, list) {//从本地拿数据，初始化historylist
            if (list) {
                state.historylist = [...list]
            }
        },
        historyAdd(state, msg) {//历史记录加一条
            state.historylist.push(msg);

        },
        handleDelHist(state) {//清空历史记录
            state.historylist = [];
        },
        initSearchKey(state, infkey) {
            state.searchKey = infkey;
        },
    },
    getters: {

    },
})